package edu.njfu.sas.servlet;

import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @Classname ServletDemo2
 * @Description TODO
 * @Date 2020/11/10 11:30 上午
 * @Created by lqj(1724226325@qq.com)
 */
@WebServlet("/demo2")
public class ServletDemo2 extends GenericServlet {
    /**
     * GenericServlet是一个抽象类,有一个抽象方法
     */
    /**
     *
     * @param servletRequest
     * @param servletResponse
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        System.out.println("GenericServlet  is in servicing !");
        PrintWriter out = servletResponse.getWriter();
        out.write("hello world!");
    }
}
